package com.oracle.mapper;

import com.oracle.pojo.Admins;
import com.oracle.pojo.AdminsExample;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface AdminsMapper {
    int countByExample(AdminsExample example);

    int deleteByExample(AdminsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Admins record);

    int insertSelective(Admins record);

    List<Admins> selectByExample(AdminsExample example);

    Admins selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Admins record, @Param("example") AdminsExample example);

    int updateByExample(@Param("record") Admins record, @Param("example") AdminsExample example);

    int updateByPrimaryKeySelective(Admins record);

    int updateByPrimaryKey(Admins record);

    @Insert("insert into admin_role(admin,role) value(#{admin},#{role})")
    int insertAdminAndRoles(@Param("admin") Integer admin,@Param("role") Integer role);

    @Select("select role from admin_role where admin=#{id}")
    List<Integer> selectRolesByAdminId(@Param("id") Integer id);

    @Delete("delete from admin_role where admin=#{id}")
    int deleteAdminRoleByAdminId(@Param("id") Integer id);
}